package com.mathdroid.gui.main.abilities.optimizer;

import java.util.LinkedList;

import com.mathdroid.gui.componentlist.AComponentListElement;
import com.mathdroid.gui.componentlist.IComponentListModel;

/**
 * This ability optimizer result list model is a simple LinkedList.
 */
public final class ResultListModel 
extends LinkedList<AComponentListElement> 
implements IComponentListModel {

	/**
	 * Default UID.
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public int addElement(final AComponentListElement e) {
		this.add(e);
		return this.size() - 1;
	}

	@Override
	public int removeElement(final AComponentListElement e) {
		final int index = this.indexOf(e);
		
		this.remove(index);
		
		return index;
	}

	@Override
	public void clear() {
		this.clear();
	}

	@Override
	public int size() {
		return super.size();
	}

}
